package observer.practice_02;

/**
 * @author yi qiang
 * @date 2021/6/17 0:23
 */
public class Client {

    public static void main(String[] args) {
        NewsAgency newsAgency=new NewsAgency();
        Baidu baidu = new Baidu();
        newsAgency.addObserver(new Sina());
        newsAgency.addObserver(baidu);
        newsAgency.updateNews("早间新闻");
        System.out.println();
        newsAgency.updateNews("午间新闻");
        System.out.println();
        newsAgency.deleteObserver(baidu);
        System.out.println();
        newsAgency.updateNews("晚间新闻");
    }

}
